<%@page import="com.wanmait.cookBook.vo.Userinfo"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%String path = request.getContextPath(); %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path %>/front/js/jquery-3.5.0.min.js"></script>
<style type="text/css">
	.head{
	width:100%;
	height:36px;
	background-color:#333333;
	overflow:hidden;
	line-height:36px;
	padding:0;
	margin:0;
	}
	
	.head>li>a{
	padding:0 10px;
	float:left;	
	color:#EEEEEE;
	text-decoration:none;
	}
	.headDiv{
		
	}
</style>
<body>
	<%Userinfo loginuser = (Userinfo)session.getAttribute("loginuser"); %>
	<%if(null==loginuser){%>
		<div class="headDiv">
			<ul class="head">
				<li style="margin-left:800px;"><a href="<%=path %>/IndexServlet">首页</a></li>
				<li><a href="<%=path %>/ShowAllCookServlet">菜谱</a></li>
				<li><a href="<%=path %>/DiaryServlet">日志</a></li>
				<li><a href="<%=path %>/front/login.jsp">登录</a></li>
				<li><a href="<%=path %>/front/login.jsp">注册</a></li>
			</ul>
		</div>
	<% } else{%>
		<div>
			<ul class="head">
				<li style="margin-left:760px;"><a href="<%=path %>/IndexServlet">首页</a></li>
				<li><a href="<%=path %>/CookServlet"><%=loginuser.getUserName() %></a></li>
				<li style="margin-left:-10px;"><a href="<%=path %>/CookServlet"><img width="30px" height="30px" style="border-radius:10px;" src="<%=path %>/front/userImages/<%=loginuser.getUserFace() %>"></a></li>
				<li><a href="<%=path %>/ShowAllCookServlet">菜谱</a></li>
				<li><a href="<%=path %>/DiaryServlet">日志</a></li>
				<li><a href="">发布</a></li>
				<li><a href="<%=path %>/UserinfoServlet?action=exitLogin">退出登录</a></li>
			</ul>
		</div>
	<%}%>
</body>
</html>